<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dubbo 分布式服务框架完全指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-hover {
            transition: all 0.3s ease;
        }
        
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        
        .section-title {
            position: relative;
            padding-left: 20px;
        }
        
        .section-title::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 24px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            padding: 20px;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
        }
        
        .highlight-box {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
            padding: 2px 8px;
            border-radius: 4px;
            display: inline-block;
        }
        
        .timeline-item {
            position: relative;
            padding-left: 40px;
            margin-bottom: 30px;
        }
        
        .timeline-item::before {
            content: '';
            position: absolute;
            left: 10px;
            top: 5px;
            width: 10px;
            height: 10px;
            background: #667eea;
            border-radius: 50%;
        }
        
        .timeline-item::after {
            content: '';
            position: absolute;
            left: 14px;
            top: 15px;
            width: 2px;
            height: calc(100% + 20px);
            background: #e0e0e0;
        }
        
        .timeline-item:last-child::after {
            display: none;
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .fade-in-up {
            animation: fadeInUp 0.6s ease-out;
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 30px 0;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6">
            <div class="text-center fade-in-up">
                <h1 class="text-5xl font-bold mb-6">Dubbo 分布式服务框架</h1>
                <p class="text-xl mb-8 opacity-90">从单体架构到分布式架构的演进之路</p>
                <div class="flex justify-center space-x-6">
                    <div class="flex items-center">
                        <i class="fas fa-network-wired text-3xl mr-3"></i>
                        <span class="text-lg">高性能RPC</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-server text-3xl mr-3"></i>
                        <span class="text-lg">服务治理</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-chart-line text-3xl mr-3"></i>
                        <span class="text-lg">智能负载均衡</span>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="container mx-auto px-6 py-12">
        <!-- 架构演进 -->
        <section class="mb-16 fade-in-up">
            <h2 class="text-3xl font-bold mb-8 section-title">架构演进历程</h2>
            
            <div class="grid md:grid-cols-3 gap-8">
                <!-- 单体架构 -->
                <div class="bg-white rounded-lg shadow-lg p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="w-12 h-12 bg-red-100 rounded-full flex items-center justify-center mr-4">
                            <i class="fas fa-cube text-red-500 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold">单体架构</h3>
                    </div>
                    <p class="text-gray-600 mb-4">所有功能模块部署在一起，适合小型应用和初创项目。</p>
                    <div class="space-y-2">
                        <div class="flex items-start">
                            <i class="fas fa-times-circle text-red-400 mt-1 mr-2"></i>
                            <span class="text-sm text-gray-700">无法实现高可用</span>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-times-circle text-red-400 mt-1 mr-2"></i>
                            <span class="text-sm text-gray-700">模块耦合度高</span>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-times-circle text-red-400 mt-1 mr-2"></i>
                            <span class="text-sm text-gray-700">难以承受高并发</span>
                        </div>
                    </div>
                </div>

                <!-- 分布式架构 -->
                <div class="bg-white rounded-lg shadow-lg p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mr-4">
                            <i class="fas fa-project-diagram text-blue-500 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold">分布式架构</h3>
                    </div>
                    <p class="text-gray-600 mb-4">业务拆分为多个子服务，部署在不同服务器上。</p>
                    <div class="space-y-2">
                        <div class="flex items-start">
                            <i class="fas fa-check-circle text-green-400 mt-1 mr-2"></i>
                            <span class="text-sm text-gray-700">服务独立部署</span>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-check-circle text-green-400 mt-1 mr-2"></i>
                            <span class="text-sm text-gray-700">故障隔离</span>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-check-circle text-green-400 mt-1 mr-2"></i>
                            <span class="text-sm text-gray-700">灵活扩展</span>
                        </div>
                    </div>
                </div>

                <!-- 集群架构 -->
                <div class="bg-white rounded-lg shadow-lg p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="w-12 h-12 bg-green-100 rounded-full flex items-center justify-center mr-4">
                            <i class="fas fa-layer-group text-green-500 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold">集群架构</h3>
                    </div>
                    <p class="text-gray-600 mb-4">同一服务部署多个实例，实现负载均衡和高可用。</p>
                    <div class="space-y-2">
                        <div class="flex items-start">
                            <i class="fas fa-check-circle text-green-400 mt-1 mr-2"></i>
                            <span class="text-sm text-gray-700">高可用保障</span>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-check-circle text-green-400 mt-1 mr-2"></i>
                            <span class="text-sm text-gray-700">负载均衡</span>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-check-circle text-green-400 mt-1 mr-2"></i>
                            <span class="text-sm text-gray-700">弹性伸缩</span>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- 生动的例子 -->
        <section class="mb-16 fade-in-up">
            <div class="bg-gradient-to-r from-purple-50 to-pink-50 rounded-lg p-8">
                <h3 class="text-2xl font-bold mb-6 flex items-center">
                    <i class="fas fa-utensils text-purple-600 mr-3"></i>
                    小饭店的故事：理解分布式与集群
                </h3>
                <div class="grid md:grid-cols-2 gap-6">
                    <div class="bg-white rounded-lg p-6">
                        <h4 class="font-semibold text-lg mb-3 text-purple-600">
                            <i class="fas fa-users mr-2"></i>集群模式
                        </h4>
                        <p class="text-gray-700">客人多了，请了第二个厨师。两个厨师都能炒一样的菜，这就是<span class="highlight-box">集群</span>。</p>
                        <p class="text-gray-600 mt-2 text-sm">多个人做同样的事，提高处理能力。</p>
                    </div>
                    <div class="bg-white rounded-lg p-6">
                        <h4 class="font-semibold text-lg mb-3 text-pink-600">
                            <i class="fas fa-sitemap mr-2"></i>分布式模式
                        </h4>
                        <p class="text-gray-700">为让厨师专心炒菜，请了配菜师负责切菜备料，这就是<span class="highlight-box">分布式</span>。</p>
                        <p class="text-gray-600 mt-2 text-sm">多个人做不同的事，各司其职。</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Dubbo 架构图 -->
        <section class="mb-16 fade-in-up">
            <h2 class="text-3xl font-bold mb-8 section-title">Dubbo 架构设计</h2>
            
            <div class="bg-white rounded-lg shadow-lg p-8">
                <div class="mermaid">
                    graph TB
                        subgraph "服务提供方"
                            P[Provider<br/>服务提供者]
                            C[Container<br/>服务容器]
                        end
                        
                        subgraph "注册中心"
                            R[Registry<br/>服务注册中心]
                        end
                        
                        subgraph "服务消费方"
                            CS[Consumer<br/>服务消费者]
                        end
                        
                        subgraph "监控中心"
                            M[Monitor<br/>监控中心]
                        end
                        
                        C -->|0.启动| P
                        P -->|1.注册| R
                        CS -->|2.订阅| R
                        R -->|3.通知| CS
                        CS -->|4.调用| P
                        P -->|5.统计| M
                        CS -->|5.统计| M
                        
                        style P fill:#4CAF50,stroke:#333,stroke-width:2px,color:#fff
                        style CS fill:#2196F3,stroke:#333,stroke-width:2px,color:#fff
                        style R fill:#FF9800,stroke:#333,stroke-width:2px,color:#fff
                        style M fill:#9C27B0,stroke:#333,stroke-width:2px,color:#fff
                        style C fill:#607D8B,stroke:#333,stroke-width:2px,color:#fff
                </div>
                
                <div class="mt-8 grid md:grid-cols-2 gap-6">
                    <div>
                        <h4 class="font-semibold text-lg mb-4">核心组件说明</h4>
                        <div class="space-y-3">
                            <div class="flex items-start">
                                <div class="w-8 h-8 bg-green-500 rounded-full flex items-center justify-center mr-3 flex-shrink-0">
                                    <i class="fas fa-server text-white text-sm"></i>
                                </div>
                                <div>
                                    <p class="font-medium">Provider（服务提供方）</p>
                                    <p class="text-sm text-gray-600">暴露服务的服务提供方</p>
                                </div>
                            </div>
                            <div class="flex items-start